<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.org/ui"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core">

    <p:dialog header="Adauga nod nou" dynamic="true" modal="true" widgetVar="treeNodeDialog" resizable="false" style="z-index: 9999">
        <h:form id="add-node-form">

            <h:panelGrid columns="2" style="margin-bottom:10px">

                <p:outputLabel for="nodeName" value="Nume: "/>
                <p:inputText id="nodeName" required="true" value="#{treeAdministrationBean.treeNode.name}" styleClass="inputs"/>

                <p:outputLabel for="nodeDescription" value="Dsc: "/>
                <p:inputText id="nodeDescription" value="#{treeAdministrationBean.treeNode.description}" styleClass="inputs"/>

                <p:outputLabel for="nodePhoneNo1" value="Telefon 1: "/>
                <p:inputText id="nodePhoneNo1" value="#{treeAdministrationBean.treeNode.tel1}"/>

                <p:outputLabel for="nodePhoneNo2" value="Telefon 2: "/>
                <p:inputText id="nodePhoneNo2" value="#{treeAdministrationBean.treeNode.tel2}"/>

                <p:outputLabel for="nodePhoneNo3" value="Telefon 3: "/>
                <p:inputText id="nodePhoneNo3" value="#{treeAdministrationBean.treeNode.tel3}"/>

                <p:outputLabel for="nodeValabilityFrom" value="Valid de la: "/>
                <p:calendar id="nodeValabilityFrom" effect="slideDown" required="true" pattern="dd.MM.yyyy"
                            value="#{treeAdministrationBean.treeNode.vldFrm}"/>

                <p:outputLabel for="nodeValabilityTo" value="Valid pina la: "/>
                <p:calendar id="nodeValabilityTo" effect="slideDown" value="#{treeAdministrationBean.treeNode.vldTo}" pattern="dd.MM.yyyy"/>

                <p:outputLabel for="nodeType" value="Tip: "/>
                <p:selectOneMenu id="nodeType" value="#{treeAdministrationBean.treeNode.tpeId}" required="true">
                    <f:selectItem itemLabel="Selectati..."/>
                    <f:selectItems var="nt" itemLabel="#{nt.groupClassificationShortName} > #{nt.name}" itemValue="#{nt.id}" value="#{treeAdministrationBean.treeNodeTypes}"/>
                </p:selectOneMenu>

            </h:panelGrid>

            <p:commandButton value="Salvează" actionListener="#{treeAdministrationBean.saveTreeNode}" oncomplete="treeNodeDialog.hide()" update=":trees-panel"/>
            <p:commandButton immediate="true" value="Anulează" oncomplete="treeNodeDialog.hide();"/>

        </h:form>
    </p:dialog>

</ui:composition>